<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>2940：[Poi2000]条纹</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Poi2000]条纹</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">[Poi2000]条纹</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                [Poi2000]条纹                </h1>
                <p>时间限制：1s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：128MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div align="center"></div>
<div><span style="font-size: 12pt">&nbsp;&nbsp;&nbsp; </span><span style="font-size: 12pt">条纹游戏是一个双人的游戏。所需要的物品有一个棋盘以及三种颜色的长方形条纹，这三种颜色分别是红色、绿色和蓝色。所有的红色条纹的尺寸是</span><span style="font-size: 12pt">c*1</span><span style="font-size: 12pt">，所有的绿色条纹的尺寸是</span><span style="font-size: 12pt">z*1</span><span style="font-size: 12pt">，所有的蓝色条纹的尺寸是</span><span style="font-size: 12pt">n*1</span><span style="font-size: 12pt">，这里</span><span style="font-size: 12pt">c,z,n</span><span style="font-size: 12pt">是正整数。每种颜色的条纹每个游戏者都拥有无限多个。</span></div>
<div><span style="font-size: 12pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 12pt">一个棋盘是一个尺寸为</span><span style="font-size: 12pt">p*1</span><span style="font-size: 12pt">的长方形，由</span><span style="font-size: 12pt">p</span><span style="font-size: 12pt">个</span><span style="font-size: 12pt">1*1</span><span style="font-size: 12pt">的方格组成。</span></div>
<div><span style="font-size: 12pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 12pt">游戏者轮流走，每一步都是由一个游戏者任选一种长方形条纹覆盖到棋盘上，并要求遵循以下规则：</span></div>
<div style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><span style="font-size: 12pt">l<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">条纹不能伸出棋盘之外。</span></div>
<div style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><span style="font-size: 12pt">l<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">不能覆盖在已有的条纹之上（即使部分也不行）。</span></div>
<div style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><span style="font-size: 12pt">l<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">条纹的边缘必须与棋盘方格的边缘相重叠。谁不能再走，谁就输了。</span></div>
<div style="margin: 0cm 0cm 0pt 21pt">&nbsp;</div>
<div style="text-indent: 21pt"><span style="font-size: 12pt">先手是指在游戏中第一个走的游戏者。那么是否不管后手怎么走，先手都有必胜策略呢？</span></div>
<div><b><span style="font-size: 12pt">任务：</span></b></div>
<div><span style="font-size: 12pt">写一个程序：</span></div>
<div style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><span style="font-size: 12pt">l<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">读入条纹的尺寸以及至少一个棋盘的尺寸。</span></div>
<div style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><span style="font-size: 12pt">l<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">对每一个给出的棋盘判断先手是否必胜。</span></div>
<div style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><span style="font-size: 12pt">l<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">将结果输出</span><span style="font-size: 12pt">。</span></div>
<div>&nbsp;</div></p><hr/><h3>输入格式</h3><p><div>&nbsp;<span style="font-size: 12pt">第一行包含三个整数</span><span style="font-size: 12pt">c,z,n(1&lt;=c,z,,n&lt;=1000)</span><span style="font-size: 12pt">，表示三种条纹的长度，依次为红色，绿色以及蓝色。每两个数之间都用空格隔开。</span></div>
<div><span style="font-size: 12pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-size: 12pt">文件的第二行包括一个整数</span><span style="font-size: 12pt">m</span><span style="font-size: 12pt">（</span>1 &lt;= m &lt;= 1000<span style="font-size: 12pt">）表示需要考虑的不同棋盘个数。以下</span><span style="font-size: 12pt">3</span><span style="font-size: 12pt">到</span><span style="font-size: 12pt">m+2</span><span style="font-size: 12pt">行每行包括一个整数</span><span style="font-size: 12pt">p</span><span style="font-size: 12pt">（</span><span style="font-size: 12pt">1&lt;=p&lt;=1000</span><span style="font-size: 12pt">）。第</span><span style="font-size: 12pt">i+2</span><span style="font-size: 12pt">行表示第</span><span style="font-size: 12pt">i</span><span style="font-size: 12pt">个棋盘的长度。</span></div>
<div>&nbsp;</div></p><hr/><h3>输出格式</h3><p><div><span style="font-size: 12pt">&nbsp;&nbsp;&nbsp;</span><span style="font-size: 12pt">应当包含</span><span style="font-size: 12pt">m</span><span style="font-size: 12pt">行。只有一个数字应当被写入文件的第</span><span style="font-size: 12pt">i</span><span style="font-size: 12pt">行：</span></div>
<div style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><span style="font-size: 12pt">l<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">1</span><span style="font-size: 12pt">&mdash;如果对第</span><span style="font-size: 12pt">i</span><span style="font-size: 12pt">个棋盘先手有必胜策略。</span></div>
<div style="margin: 0cm 0cm 0pt 21pt; text-indent: -21pt"><span style="font-size: 12pt">l<span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 12pt">2</span><span style="font-size: 12pt">&mdash;其它。</span></div>
<div>&nbsp;</div></p><hr/><h3>样例输入</h3><pre>1 5 1


3 
1 
5 
6 

 
</pre><hr/><h3>样例输出</h3><pre> 
1
1 
2
</pre><hr/><h3>提示</h3><p>没有写明提示</p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=2940" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=2940" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>